%======================================================
% Technische Universitaet Darmstadt
% Fachbereich Elektrotechnik und Informationstechnik
% Fachbereich Informatik (Zweitmitglied)
% Fachgebiet Multimedia Kommunikation (KOM)
% Prof. Dr.-Ing. Ralf Steinmetz
%======================================================
% Template for Theses
% VERSION 1.0 (October 2009)
% Use pdfLaTeX (other possible, but not supported)
% Contact at KOM: Andr\'e Miede (andre.miede@kom...)
%======================================================
% Official TUD-LaTeX-files have to be installed:
% http://exp1.fkp.physik.tu-darmstadt.de/tuddesign/
% Refer to the manuals and forum for details
%======================================================
\documentclass[longdoc,colorbacktitle=tud1c,accentcolor=tud1c,11pt,paper=a4]{tudexercise}
%======================================================
% colorback = Bereich unter Titel mit Hintergrundfarbe
% colorbacktitle = Titel mit Hintergrundfarbe (Akzent)
% KOM-Blau = accentcolor=tud1b		
% Grau = accentcolor=tud0a 
% blackrule fuer schwarze Leiste
% nochapterpage = do not start chapters on new page
% oneside = print only on one side of the page
%======================================================

%======================================================
% General package loading and definitions
%======================================================
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{textcomp} 

%\usepackage[english]{babel}
\usepackage{xspace}
\usepackage[fleqn]{amsmath} % math environments and more by the AMS 
\usepackage{listings}
\newcounter{dummy} % necessary for correct hyperlinks (to index, bib, etc.)
\newcommand{\myfloatalign}{\centering} % how all the floats will be aligned
\title{Exercise 1}
\institution{ES TU Darmstadt}
%========\chapter{Background}==============================================
% MAIN DOCUMENT STARTS HERE
%======================================================
\begin{document}
%======================================================
\maketitle



\ \\
Jane Doe is a journalist and has a weekly column in a newspaper.
She specializes in giving tips and preparing puzzles for a host of board games including Chess, Checkers, Sokoban, and quite a few more.
So every week she prepares a set of riddles for a few games, tries them out, and then prepares a textual representation for her column.
This process is quite manual and is slowly grating on her nerves. She hopes to
be able to optimize the process and has requested our help after hearing about metamodelling and graph transformations.

\ \\
\section{Metamodel}

First you must specify a metamodel for a generic board game.
Prepare this metamodel with relevant concepts like a game logic, board, figures
and fields.

\begin{figure}[htbp]
	\centering
	\includegraphics[scale=0.75]{../images/GenericBoardTemplate}
\end{figure}

\ \\
In the picture you see the relevant EClasses, attributes and all needed
functions. We recommend that you download our template eap file at [LINK].
Now you need to connect the EClasses.
\\
Things to consider:
\begin{itemize}
\item The GameLogic should create and initialize the Board.
\item The GameLogic should know the currently selected figure.
\item The Board should have Fields.
\item Fields should know their neighbours (up, down, left, right).
\end{itemize}

\ \\
After doing this, generate code and create some dynamic instances to check your
logic.

\newpage
\subsection{Solution}

\begin{figure}[h]
\centering
    \includegraphics[scale=1.0]{../images/GenericBoardMM}
  \end{figure}


\newpage
\section{Controller}

In this task you have to connect your model with the provided GUI by adapting
the controller. Here you can download the GUI [LINK].
The relevant code snippets are marked with ``ToDo:``.


\ \\
\subsection{Solution:}


\begin{figure}[h]

	\includegraphics[scale=0.75]{../images/controller}
\end{figure}


\section{SDM}

Now it`s time for your first SDMs. We are going to initialise our board and
fields and then modelise some figures.
\subsection{Initialize Board}
In the picture you see empty story nodes. 
You have to specify a SDM that builds up and initiallises the board.

\subsection{GameLogic Select Figure}
Now you should modelise the GameLogic:fieldPressed method to select a figure and
if a figure is already selected to call the Figure:moveTo function.

\subsection{Modellise A Figure}
After this you should modellise a figure (e.g. king or knight in Chess). In
order to do this you should create a SDM for moveTo.


\ \\
\underline{Solution:}
Look at the EAP file.







%ToDo
%Provided

%    Exercise sheet
%    GUI and controller

 

%Solution

%    Metamodel, generated code and adapted controller
%    SDMs with brief explanation (comments in EA for example)

\end{document}
%======================================================
%======================================================